@extends('layouts.app')
@include('package.sidebar')
@section('content')
    <div class="content">
        <div class="row custom-invoice">
            <form class="form form-inline" method="post" action="{{ route('admin.package.spec.update', ['id' => $package->id]) }}">
                <input type="hidden" value="{{ csrf_token() }}" name="_token">
                <table class="table table-striped table-hover">
                    <thead>
                    @foreach($attr as $item)
                        @php
                            $group = $value->get($item->id);
                        @endphp
                        <tr>
                            <th colspan="2" style="text-align: center; font-size: 20px"> {{ $item->name }}</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach($group as $key => $value1)
                            @php
                                $tmp = $spec->get($value1->id);
                            @endphp
                            <tr>
                                <td style="text-align: right; vertical-align: middle; padding: 0 60px; font-weight: bold"  width="50%">{{ $value1->value }}</td>
                                <td>
                                    <div class="form-group" style="text-align: center; margin: 0 60px;">
                                        <label for="value[{{$tmp->id}}]">价格变动:</label>
                                        <input class="form-control" type="text" name="value[{{$tmp->id}}]" value="{{ $tmp->premium/100 }}">
                                    </div>
                                </td>
                            </tr>
                        @endforeach
                    @endforeach
                    </tbody>
                </table>
                <input type="submit" class="form-control btn btn-success" value="保存">
            </form>
        </div>
    </div>
@endsection
